package com.huayi.website.service.impl;

import com.huayi.website.entity.BannerEntity;
import com.huayi.website.entity.EnumPages;
import com.huayi.website.repository.BannerRepository;
import com.huayi.website.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BannerServiceImpl implements BannerService {
    @Autowired
    private BannerRepository repository;

    @Override
    public List<BannerEntity> getAllList(EnumPages webColumn) {
        return repository.getAllList(webColumn);
    }

    @Override
    public BannerEntity getById(Integer bannerId) {
        return repository.getById(bannerId);
    }

    @Override
    public void deleteBanner(Integer bannerId) {
        repository.deleteBanner(bannerId);
    }

    @Override
    public Integer editBanner(Integer bannerId, String title,String url, Integer sort, String image,Integer columnId) {
        return repository.editBanner(bannerId,title,url,sort,image, columnId);
    }
}
